package GoFPatterns.kuang.simple.factory;

import GoFPatterns.kuang.simple.dao.CarDao;
import GoFPatterns.kuang.simple.dao.impl.BWMDaoImpl;
import GoFPatterns.kuang.simple.dao.impl.TeslaDaoImpl;

public class CarFactory {

    /**
     * 根据需求，获取相应车辆
     * @param car
     * @return
     */
    public CarDao Car(String car){
        switch (car){
            case "BWM":
                return new BWMDaoImpl();
            case "Tesla":
                return new TeslaDaoImpl();
            default:
                return null;
        }
    }
}
